<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>提货</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../script/common.js"></script>
<script language="javascript" type="text/javascript">
	function query() {
		window.location.href = "main/pomain/queryvender.jsp";
	}
	function goPage(currentpage){
		window.location.href = "vender?currentpage="+currentpage;
	}
	function del(obj){
		if(confirm("确认删除吗？")){
			var tr = obj.parentNode.parentNode;
			var vendercode = tr.cells[0].innerHTML;
			window.location.href="delvender?vendercode="+vendercode+"&currentpage="+${page.currentPage};
		}
	}
	function jumpToPage(obj){
			goPage(obj.value);
	}
</script>
</head>
<body>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td nowrap class="title1">您的位置：工作台面－－供应商管理</td>
  </tr>
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30px" nowrap class="toolbar">&nbsp;</td>
    <td width="40px" nowrap class="toolbar" onMouseOver="OMO(event)" onMouseOut="OMOU(event)"><a href="../../main/pomain/vender_manage.jsp?op=add"><img src="../../images/new.gif">新增</a></td>
	<td class="toolbar">
  	<form action="queryvender" method="post">
  	根据条件过滤： <input placeholder="供应商编号" type="text" name="vendercode"/><input placeholder="供应商名称" type="text" name="name"/><input type="submit" value="根据条件查找"/>
  	</form>
  	</td>
  </tr>
</table>
<table width="100%"  border="0" align="center" cellspacing="1">
  <tr>
    <td class="title1">供应商编号</td>
    <td class="title1">供应商名称</td>
	<td class="title1">联系人</td>
	<td class="title1">地址</td>
    <td class="title1">邮政编码</td>
 
    <td class="title1">注册日期</td>
    <td class="title1">电话</td>
    <td class="title1">传真</td>
    <td class="title1">操作</td>
  </tr>

  <c:forEach items="${page.dataList}" var="vender">
  <tr>
    <td align="center">${vender.venderCode }</td>
    <td align="center">${vender.name }</td>
	<td align="center">${vender.contactor }</td>
	<td align="center">${vender.address }</td>
    <td align="center">${vender.postCode }</td>
 
    <td align="center">${vender.createDate }</td>
    <td align="center">${vender.tel }</td>
    <td align="center">${vender.fax }</td>
    <td align="center"><a href="../../main/pomain/vender_manage.jsp?name=${vender.name }&vendercode=${vender.venderCode }
    &contactor=${vender.contactor}&address=${vender.address}&postcode=${vender.postCode}
    &createdate=${vender.createDate}&tel=${vender.tel}&fax=${vender.fax}&password=${vender.password}&op=change">修改</a> <a onclick="del(this)">删除</a></td>
  </tr>
  </c:forEach>
  <tr>
  	<td class="title2" colspan="9"><span style="color:red">${info }</span></td>
  </tr>
</table><br/>
<center>
 当前第${page.currentPage}页 ，每页显示${page.pageSize }数据
    
    <c:if test="${page.currentPage == 1}">
    	<input type="button" value="首页" disabled="disabled"/>
    	<input type="button" value="上一页" disabled="disabled"/>
    </c:if>
    <c:if test="${page.currentPage != 1}">
	    <input type="button" value="首页" onclick="goPage(1)"/>
	    <input type="button" value="上一页" onclick="goPage(${page.currentPage-1})"/>
    </c:if>
    <c:if test="${page.currentPage == page.pageCount }">
	    <input type="button" value="下一页" disabled="disabled"/>
	    <input type="button" value="末页" disabled="disabled"/>
    </c:if>
    <c:if test="${page.currentPage != page.pageCount }">
	    <input type="button" value="下一页" onclick="goPage(${page.currentPage+1})"/>
	    <input type="button" value="末页" onclick="goPage(${page.pageCount})"/>
    </c:if>
    
    
    共${page.pageCount }页 ${page.totalCount }条记录 
    &nbsp;前往第<select onchange="jumpToPage(this)"><c:forEach var="p" begin="1" end="${page.pageCount }">
    	<c:if test="${p==page.currentPage }"><option selected>${p}</option></c:if>
    	<c:if test="${p!=page.currentPage }"><option>${p}</option></c:if>
    </c:forEach></select>页
   </center>
</body>
</html>